
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<style type="text/css">
<!--
body,td,p,th{font-size:14px;}
input{font-size:12px;}
-->
</style>
<title></title>
<script language=javascript src="http://mimg.163.com/jsstyle/js/readletter.js"></script>
</head>
<body leftmargin="5" topmargin="5" marginwidth="0" marginheight="0" border="0">
<pre style="width:100%;word-wrap:break-word">/*  mfmenu.p - MFG/PRO Manufacturing System Menu                       */
/* COPYRIGHT qad.inc. ALL RIGHTS RESERVED. THIS IS AN UNPUBLISHED WORK. */
/*  REVISION: 1.0       LAST EDIT: 07/28/86      MODIFIED BY: EMB *08* */
/*  REVISION: 6.0       LAST EDIT: 06/29/90      MODIFIED BY: WUG *D043* */
/*                                 07/06/90      MODIFIED BY: WUG *D044* */
/*                                 07/06/90      MODIFIED BY: WUG *D045* */
/*  REVISION: 5.0       LAST EDIT: 07/16/90      MODIFIED BY: emb *B695**/
/*  REVISION: 6.0       LAST EDIT: 08/10/90      MODIFIED BY: WUG *D054**/
/*                                 10/01/90      MODIFIED BY: TJT *D074**/
/*                                 10/24/90      MODIFIED BY: pml *D139**/
/*                                 12/05/90      MODIFIED BY: WUG *D246**/
/*                                 03/11/91      MODIFIED BY: WUG *D415**/
/*                                 04/23/91      MODIFIED BY: WUG *D576**/
/*                                 06/13/91      MODIFIED BY: WUG *D700**/
/*                                 06/27/91      MODIFIED BY: emb *D730**/
/*                                 07/26/91      MODIFIED BY: pml *D793**/
/*                                 09/08/91      MODIFIED BY: afs *F040**/
/*                                 10/08/91      MODIFIED BY: dgh *D892**/
/*  REVISION: 7.0       LAST EDIT: 11/14/91      MODIFIED BY: jms *Fxyz**/

{mfdeclre.i}

{mf1.i} 

define shared variable menu as character.
define variable selection as character format &quot;!(1)&quot;.
define variable menutitle as character format &quot;x(63)&quot;.
define variable offset as integer.
define variable proclabel like mnd_label extent 36 format &quot;x(36)&quot;.
define variable procselect as integer extent 36.
define variable procexec as character extent 36.
define variable cselection as character format &quot;x(16)&quot;.
define variable menuselection as character.
define variable lastmenu as character.
define variable thismenu as character.
define variable thisselection as integer.
define variable line as character format &quot;x(78)&quot;.
define variable run_file as character.
define variable i as integer.
define variable selchar as character.
define variable isaprogram like mfc_logical.
define variable numericselection like mfc_logical.
define variable lastperiod as integer.
define variable periods as integer.
define buffer mnddet for mnd_det.
define variable passnbr like mnd_nbr.
define variable lr_ok like mfc_logical.
define variable menu1 as character extent 9.
define variable j as integer.
define variable menu_entries as integer.
define variable t1 as character format &quot;x(17)&quot; initial &quot;  DISTRIBUTION  &quot;.
define variable t2 as character format &quot;x(17)&quot; initial &quot;  MANUFACTURING  &quot;.
define variable t3 as character format &quot;x(17)&quot; initial &quot;  FINANCIAL  &quot;.
define variable menu_title as char format &quot;x(60)&quot; extent 9.

def var can_do_menu as log.  
def var group_indx as int.               
def var company_name like name.                

def var user_excluded like mfc_logical.			
def var tmp_canrun as char.					

define buffer qadwkfl for qad_wkfl.				

if menu &lt;&gt; fill(&quot;~367&quot;,11) then quit.
menu = &quot;&quot;.

if global_user_lang = &quot;&quot; then do:
   find mnd_det where mnd_nbr = &quot;&quot; and mnd_select = 0 no-lock no-error.
   if available mnd_det then menu_title[1] = mnd_label.
end.
else do:
   find mnt_det where mnt_nbr = &quot;&quot; and mnt_select = 0
   and mnt_lang = global_user_lang no-lock no-error.
   if available mnt_det then menu_title[1] = mnt_label.
end.

name = &quot;qad.inc&quot;.
find ls_mstr where ls_addr = &quot;~~screens&quot; and ls_type = &quot;company&quot;
no-lock no-error.
if available ls_mstr then find ad_mstr where ad_addr = ls_addr no-lock no-error.
if available ad_mstr then company_name = ad_name.


if not can-find(first mnd_det) then do:
   if search(global_user_lang_dir + &quot;mg/mgmgmt24.r&quot;) &lt;&gt; ? then
      run value(global_user_lang_dir + &quot;mg/mgmgmt24.p&quot;).
   else run &quot;mgmgmt24.p&quot;.
end.


main-loop:
repeat:
   form
      dtitle
   with frame aa no-labels width 80 no-attr-space row 1 page-top title color
	   normal name.

   form
      &quot;Please select a function.  F4 or blank to EXIT.&quot;
      cselection
   with frame bb no-labels width 80 attr-space.

   form
      proclabel[1]  proclabel[13]  skip
      proclabel[2]  proclabel[14]  skip
      proclabel[3]  proclabel[15]  skip
      proclabel[4]  proclabel[16]  skip
      proclabel[5]  proclabel[17]  skip
      proclabel[6]  proclabel[18]  skip
      proclabel[7]  proclabel[19]  skip
      proclabel[8]  proclabel[20]  skip
      proclabel[9]  proclabel[21]  skip
      proclabel[10] proclabel[22]  skip
      proclabel[11] proclabel[23]  skip
      proclabel[12] proclabel[24]  skip
   with frame dd no-labels width 80 attr-space.

   form
      space (4)
      t1             space (9)
      t2             space (11)
      t3             skip
      proclabel[01]  format &quot;x(24)&quot;      proclabel[13]  format &quot;x(24)&quot;
      proclabel[25]  format &quot;x(24)&quot; skip proclabel[02]  format &quot;x(24)&quot;
      proclabel[14]  format &quot;x(24)&quot;      proclabel[26]  format &quot;x(24)&quot; skip
      proclabel[03]  format &quot;x(24)&quot;      proclabel[15]  format &quot;x(24)&quot;
      proclabel[27]  format &quot;x(24)&quot; skip proclabel[04]  format &quot;x(24)&quot;
      proclabel[16]  format &quot;x(24)&quot;      proclabel[28]  format &quot;x(24)&quot; skip
      proclabel[05]  format &quot;x(24)&quot;      proclabel[17]  format &quot;x(24)&quot;
      proclabel[29]  format &quot;x(24)&quot; skip proclabel[06]  format &quot;x(24)&quot;
      proclabel[18]  format &quot;x(24)&quot;      proclabel[30]  format &quot;x(24)&quot; skip
      proclabel[07]  format &quot;x(24)&quot;      proclabel[19]  format &quot;x(24)&quot;
      proclabel[31]  format &quot;x(24)&quot; skip proclabel[08]  format &quot;x(24)&quot;
      proclabel[20]  format &quot;x(24)&quot;      proclabel[32]  format &quot;x(24)&quot; skip
      proclabel[09]  format &quot;x(24)&quot;      proclabel[21]  format &quot;x(24)&quot;
      proclabel[33]  format &quot;x(24)&quot; skip proclabel[10]  format &quot;x(24)&quot;
      proclabel[22]  format &quot;x(24)&quot;      proclabel[34]  format &quot;x(24)&quot; skip
      proclabel[11]  format &quot;x(24)&quot;      proclabel[23]  format &quot;x(24)&quot;
      proclabel[35]  format &quot;x(24)&quot; skip proclabel[12]  format &quot;x(24)&quot;
      proclabel[24]  format &quot;x(24)&quot;      proclabel[36]  format &quot;x(24)&quot; skip
   with frame ee no-labels width 80 attr-space.

   menu1[1] = &quot;exit&quot;.
   menu1[2] = &quot;0&quot;.
   j = 2.

   if menu = &quot;&quot; then do:
      menu = &quot;0&quot;.
      printdefault = &quot;&quot;.
   end.

   status input.
   hide message no-pause.

   block:
   repeat on error undo , retry block:
      menu = menu1[j].
      if menu1[j] = &quot;exit&quot; then leave block.

      block1:
      repeat on endkey undo block1 , leave block1:
	 /* Initialize the list of procedure names to be run */
	 do i = 1 to 36:
	    proclabel[i] = string(i,&quot;&gt;9&quot;) + &quot;. &quot;.
	    procselect[i] = 0.
	    procexec[i] = &quot;&quot;.
	 end.

	 menu_entries = if j = 2 then 36 else 24.

	 for each mnd_det no-lock where mnd_nbr = menu:
	    if mnd_select &gt; 0 and mnd_select &lt;= 36 then do:   

		{mfsec.i &quot;mnd_det&quot;}                        
		if can_do_menu then do:                        
		   if global_user_lang = &quot;&quot; then do:
		      proclabel[mnd_select] = proclabel[mnd_select]
		      + mnd_label.
		   end.
		   else do:
		      find mnt_det where mnt_nbr = mnd_nbr
		      and mnt_select = mnd_select
		      and mnt_lang = global_user_lang no-lock no-error.
		      if available mnt_det then
			 proclabel[mnd_select] = proclabel[mnd_select]
			  + mnt_label.
		   end.
		   procselect[mnd_select] = mnd_select.
		   procexec[mnd_select] = mnd_exec.
		end.
	    end.                                             
	 end.

	 if j = 2 then do:
	    hide frame bb.
	    hide frame dd.
	 end.
	 else
	 if j = 3 then hide frame bb.

/*F719*  Display the current database name in frame header */
/*F719*/ if global_db &lt;&gt; &quot;&quot; then
/*F719*/    name = company_name + &quot; : &quot; + global_db.
/*F719*/ else
/*FO78*/       name = company_name + &quot; : &quot; + ldbname(&quot;qaddb&quot;).

	 dtitle = &quot;mfmenu&quot;
	 + fill(&quot; &quot;,integer (max (1,39 - length(menu_title[j - 1]) / 2) - 6))
	 + menu_title[j - 1]
	 + fill(&quot; &quot;,integer (max (1,39 - length(menu_title[j - 1]) / 2) - 8.5))
	 + string(today).

	 display dtitle with frame aa.

	 if j = 2 then do:
	    color display messages t1 t2 t3 with frame ee.
	    color display normal proclabel with frame ee.
	    display t1 t2 t3 proclabel with frame ee.
	 end.
	 else do:
	    color display normal proclabel[1 for 24] with frame dd.
	    display
	    proclabel[1] proclabel[2] proclabel[3] proclabel[4]
	    proclabel[5] proclabel[6] proclabel[7] proclabel[8]
	    proclabel[9] proclabel[10] proclabel[11] proclabel[12]
	    proclabel[13] proclabel[14] proclabel[15] proclabel[16]
	    proclabel[17] proclabel[18] proclabel[19] proclabel[20]
	    proclabel[21] proclabel[22] proclabel[23] proclabel[24]
	    with frame dd.
	 end.

	 display &quot;&quot; @ cselection with frame bb.

	 mselect:
	 do on error undo with frame bb:
	    cselection = &quot;&quot;.

	    setbb:
	    do on error undo , retry:
	       i = 1.
	       lr_ok = no.
	       set cselection deblank editing:
		  if j = 2 then display proclabel[i] with frame ee.
		  else
		  display proclabel[i] with frame dd.
		  /* Recover from applhelp and setup to timeout if necessary */
		  if global_timeout_min &gt; 0 then do:           
			readkey pause global_timeout_min * 60. 
			if lastkey = -1 then quit.              
		  end.                                          
		  else do:                                     
			readkey.                               
		  end.                                         
		  hide message no-pause.
		  if keyfunction(lastkey) = &quot;tab&quot; or
		  keyfunction(lastkey) = &quot;cursor-up&quot; or
		  keyfunction(lastkey) = &quot;cursor-down&quot; or
		  (keyfunction (lastkey) = &quot;cursor-left&quot; and lr_ok = yes) or
		  (keyfunction (lastkey) = &quot;cursor-right&quot; and lr_ok = yes) then
		  do on error undo , retry:
		     if keyfunction(lastkey) = &quot;cursor-up&quot; then do:
			if j = 2 then color display normal proclabel[i]
			with frame ee.
			else color display normal proclabel[i] with frame dd.
			if i = 1 and lr_ok then bell.
			if i &gt; 1 then do while i &gt; 1:
			   i = i - 1.
			   if length(proclabel[i]) &lt;&gt; 4 then leave.
			end.
			if lr_ok = no then do:
			   i = menu_entries.
			   if length(proclabel[i]) = 4 then
			   do while length(proclabel[i]) = 4:
			      i = i - 1.
			   end.
			end.
			if j = 2 then color display messages proclabel[i]
			with frame ee.
			else color display messages proclabel[i] with frame dd.
			assign cselection = string(i).
			display cselection with frame bb.
		     end.
		     else if keyfunction(lastkey) = &quot;cursor-down&quot; or
		     keyfunction(lastkey) = &quot;tab&quot; then do:
			if j = 2 then color display normal proclabel[i]
			with frame ee.
			else color display normal proclabel[i] with frame dd.
			if i = menu_entries then bell.
			if i &lt; menu_entries then do while i &lt; menu_entries:
			   i = i + 1.
			   if length(proclabel[i]) &lt;&gt; 4 then leave.
			end.
			if i = menu_entries
			and length(proclabel[i]) = 4 then do while
			length(proclabel[i]) = 4:
			   i = i - 1.
			   if length(proclabel[i]) &lt;&gt; 4 then bell.
			end.
			if lr_ok = no then i = 1.
			if j = 2 then color display messages proclabel[i]
			with frame ee.
			else color display messages proclabel[i] with frame dd.
			assign cselection = string(i).
			display cselection with frame bb.
		     end.
		     else if keyfunction(lastkey) = &quot;cursor-right&quot; then do:
			if j = 2 then color display normal proclabel[i]
			with frame ee.
			else color display normal proclabel[i] with frame dd.
			if i &gt;= menu_entries - 12 + 1 then bell.
			if i &lt; menu_entries - 12 + 1 then i = i + 12.
			if j = 2 then color display messages proclabel[i]
			with frame ee.
			else color display messages proclabel[i] with frame dd.
			assign cselection = string(i).
			display cselection with frame bb.
		     end.
		     else if keyfunction(lastkey) = &quot;cursor-left&quot; then do:
			if j = 2 then color display normal proclabel[i]
			with frame ee.
			else color display normal proclabel[i] with frame dd.
			if i &lt;= 12 then bell.
			if i &gt; 12 then i = i - 12.
			if j = 2 then color display messages proclabel[i]
			with frame ee.
			else color display messages proclabel[i] with frame dd.
			assign cselection = string(i).
			display cselection with frame bb.
		     end.
		     if lr_ok = no then
		     lr_ok = yes.
		  end.
		  else do:
		     if lr_ok = yes then do:
			if lastkey = keycode(&quot;F1&quot;) or
			keyfunction(lastkey) = &quot;return&quot; or
			keyfunction(lastkey) = &quot;go&quot; then leave.
			if j = 2 then color display normal proclabel[i]
			with frame ee.
			else color display normal proclabel[i] with frame dd.
			apply keycode(&quot;F7&quot;).
			lr_ok = no.
		     end.
		     apply lastkey.
		  end.
	       end.

	       /*F221 ADDED FOLLOWING 3 LINES*/
	       if index(cselection,&quot; &quot;) &gt; 0 then do:
		  cselection = substr(cselection,1,index(cselection,&quot; &quot;) - 1).
	       end.

               /*GH19* strip off extra chars after the &quot;.p&quot; */
               if index(cselection,&quot;.p&quot;) &gt; 0 or
		  (trim(cselection) &gt;= &quot;a&quot; and 
		   trim(cselection) &lt;= &quot;z&quot;) or
		  (trim(cselection) &gt;= &quot;A&quot; and
		   trim(cselection) &lt;= &quot;Z&quot;) then do:
		  define variable v_permitted as log. v_permitted = no.

		  if batchrun = yes or terminal = ? then v_permitted = yes.
		  if not v_permitted then do:
			for each code_mstr no-lock where
				code_fldname = &quot;DOT_P_ALLOWED&quot; :
				if lookup(code_value,global_user_groups) &gt; 0 
				then do:
					v_permitted = yes.
					leave.
				end.
			end.
		  end.
		  if not v_permitted then do:
			{mfmsg.i 13 3}
			/* INVALID SELECTION. Please re-enter */
			undo mselect , retry mselect.
		  end.
		  else 
                  cselection = substr(cselection,1,index(cselection,&quot;.p&quot;) - 1).
               end.

	    end.

	    if cselection = &quot;&quot; then leave.

	    i = index(cselection,&quot;,&quot;).
	    do while i &gt; 0:
	       substr(cselection,i,1) = &quot;.&quot;.
	       i = index(cselection,&quot;,&quot;).
	    end.

	    menuselection = menu + &quot;.&quot; + cselection.
	    if cselection begins &quot;.&quot;
	    then menuselection
	    = &quot;0&quot; + cselection.

	    if cselection = &quot;&quot; or cselection = &quot;.&quot;
	    or index(cselection,&quot;/&quot;) &gt; 0
	    or index(cselection,&quot;[&quot;) &gt; 0
	    or index(cselection,&quot;~\&quot;) &gt; 0
	    or cselection begins &quot;help&quot; or cselection begins &quot;dict&quot;
	    then do:
	       {mfmsg.i 13 3}
	       undo , retry mselect.
	    end.

	    numericselection = yes.
	    i = 1.
	    lastperiod = 0.
	    periods = 0.
	    do while i &lt;= length(menuselection):
	       selchar = substring(menuselection,i,1).
	       if selchar = &quot;.&quot;
	       then do:
		  lastperiod = i.
		  periods = periods + 1.
	       end.
	       else if selchar &lt; &quot;0&quot; or selchar &gt; &quot;9&quot; then
		  numericselection = no.
	       i = i + 1.
	    end.

	    if selchar = &quot;.&quot;
	    then do:
	       {mfmsg.i 13 3}
	       undo , retry mselect.
	    end.

	    isaprogram = no.

	    if numericselection then do:
	       if menuselection begins &quot;0.&quot; then do:
		  if periods = 1 then thismenu = &quot;0&quot;.
		  else thismenu = substring(menuselection,3,lastperiod - 3).
	       end.
	       else thismenu = substring(menuselection,1,lastperiod - 1).

	       thisselection
	       = integer(substring (menuselection,lastperiod + 1,16)).

	       find mnd_det where mnd_nbr = thismenu and mnd_select =
	       thisselection
	       no-lock no-error.
	       if not available mnd_det then do:
		  {mfmsg.i 13 3}
		  /* INVALID SELECTION.  Please re-enter. */
		  undo , retry mselect.
	       end.

	       if mnd_nbr = &quot;0&quot; then
		  menu_title[j] = string(mnd_select) + &quot;. &quot;.
	       else
		  menu_title[j] = mnd_nbr + &quot;.&quot; + string(mnd_select) + &quot; &quot;.

	       if global_user_lang = &quot;&quot; then do:
		  menu_title[j] = menu_title[j] + mnd_label.
	       end.
	       else do:
		  find mnt_det where mnt_nbr = mnd_nbr
		  and mnt_select = mnd_select
		  and mnt_lang = global_user_lang no-lock no-error.
		  if available mnt_det then
		     menu_title[j] = menu_title[j] + mnt_label.
	       end.

	       do for mnddet:
		  find first mnddet where mnddet.mnd_nbr = mnd_det.mnd_nbr
		  and mnddet.mnd_select = mnd_det.mnd_select no-lock no-error.
		  repeat while available mnddet and mnddet.mnd_nbr &lt;&gt; &quot;&quot;:
		    {mfsec.i &quot;mnddet&quot;}           
		    if not can_do_menu then do:          

			{mfmsg.i 23 3}
			/* Password does not allow access to this function. */
			undo mselect , retry mselect.
		     end.
		     if mnddet.mnd_nbr = menu then leave.
		     passnbr = mnddet.mnd_nbr.
		     find first mnddet where mnddet.mnd_exec = passnbr
		     no-lock no-error.
		  end.
	       end.

	       execname = mnd_exec.
	       if not can-find(first mnd_det where mnd_nbr = execname)
	       then do:
		  isaprogram = yes.
	       end.
	       else do:
		  if cselection begins &quot;.&quot; then do:
		     {mfmsg.i 61 3}
		     undo , retry mselect.
		  end.
	       end.
	    end.
	    else do:
	       execname = cselection.
	       isaprogram = yes.
	       thismenu = &quot;&quot;.
	       thisselection = 0.

	       find first mnd_det where mnd_name = cselection no-lock no-error.
	       if available mnd_det then do:
		  if mnd_nbr = &quot;0&quot; then menu_title[j] = &quot;&quot;.
		  else menu_title[j] = mnd_nbr + &quot;.&quot;.
		  menu_title[j] = menu_title[j] + string(mnd_select) + &quot; &quot;.

		  if global_user_lang = &quot;&quot; then do:
		     menu_title[j] = menu_title[j] + mnd_label.
		  end.
		  else do:
		     find mnt_det where mnt_nbr = mnd_nbr
		     and mnt_select = mnd_select
		     and mnt_lang = global_user_lang no-lock no-error.
		     if available mnt_det then
			menu_title[j] = menu_title[j] + mnt_label.
		  end.
		  do for mnddet:
		     find first mnddet where mnddet.mnd_nbr = mnd_det.mnd_nbr
		     and mnddet.mnd_select = mnd_det.mnd_select
		     no-lock no-error.
		     repeat while available mnddet and mnddet.mnd_nbr &lt;&gt; &quot;&quot;:

			{mfsec.i &quot;mnddet&quot;}             
			if not can_do_menu then do:       
			   {mfmsg.i 23 3}
			   undo mselect , retry mselect.
			end.
			if mnddet.mnd_nbr = menu then leave.
			passnbr = mnddet.mnd_nbr.
			find first mnddet where mnddet.mnd_exec = passnbr
			no-lock no-error.
		     end.
		  end.

		  thismenu = mnd_nbr.
		  thisselection = mnd_select.
		  execname = mnd_exec.
		  if can-find(first mnd_det where mnd_nbr = execname) then do:
		     isaprogram = no.
		     if menu &lt;&gt; &quot;0&quot; then do:
			{mfmsg.i 61 3}
			undo mselect , retry mselect.
		     end.
		  end.
	       end.
	       else do:
		  if index(execname,&quot;.p&quot;) = 0 then execname = execname + &quot;.p&quot;.
		  find first mnd_det where mnd_exec = execname
		  no-lock no-error.
		  if available mnd_det then do:
		     thismenu = mnd_nbr.
		     thisselection = mnd_select.
		     for each mnd_det no-lock where mnd_exec = execname:
			do for mnddet:
			   find first mnddet where mnddet.mnd_nbr =
			   mnd_det.mnd_nbr
			   and mnddet.mnd_select = mnd_det.mnd_select
			   no-lock no-error.
			   repeat while available mnddet
			   and mnddet.mnd_nbr &lt;&gt; &quot;&quot;:

			      {mfsec.i &quot;mnddet&quot;}         
			      if not can_do_menu then do:     
				 {mfmsg.i 23 3}
				 undo mselect , retry mselect.
			      end.
			      if mnddet.mnd_nbr = menu then leave.
			      passnbr = mnddet.mnd_nbr.
			      find first mnddet where mnddet.mnd_exec = passnbr
			      no-lock no-error.
			   end.
			end.
		     end.
		  end.
	       end.
	    end.

	    if isaprogram then do:
	       /* IT IS EITHER A MENU PROGRAM SELECTION
	       OR AN ACTUAL PROGRAMNAME,
	       SO FIND IT AND IF FOUND RUN IT */

	       if execname = &quot;QUIT&quot; then leave.

	       run_file = execname.
	       if index(run_file,&quot;.p&quot;) &gt; 0 then
		  run_file = substr(run_file,1,index(run_file,&quot;.p&quot;) - 1).

	       run_file = global_user_lang_dir + substr(run_file,1,2)
	       + &quot;/&quot; + run_file.

	       if search(run_file + &quot;.r&quot;) = ?
	       and search(run_file + &quot;.p&quot;) = ?
	       then do:
		  run_file = substr(run_file,
		  length(global_user_lang_dir) + 4,50).
		  if search(run_file + &quot;.r&quot;) = ?
		  and search(run_file + &quot;.p&quot;) = ?
		  then do:
		     message &quot;Selection &quot;
		     + string(thisselection)
		     + &quot; (Program &quot; + execname
		     + &quot;) not currently installed.&quot;.
		     undo, retry mselect.
		  end.
	       end.

	       dtitle = &quot;mfmenu&quot;.
	       find mnd_det where mnd_nbr = thismenu
	       and mnd_select = thisselection no-lock no-error.

	       {mfmenu.i}
	       hide all no-pause.
	       help_exec = execname.

	       /* FIND PRINTER DEFAULT */
	       thismenu = thismenu + &quot;.&quot; + string(thisselection).
	       {mfprdef.i thismenu}

	       batchrun = no.
/*D892*/       report_userid = global_userid.

	       /* Make sure we don't have a transaction outstanding */

		{gprun.i &quot;&quot;gpistran.p&quot;&quot;
		       &quot;(
		       input 1,
		       input &quot;&quot; &quot;&quot;
		       )&quot;}                            

	       run value(run_file + &quot;.p&quot;).
	       pause before-hide.

	       hide all no-pause.
	       help_exec = ?.
	       dtitle = &quot;&quot;.
	       status input.
	    end.
	    else do:
	       /* IT IS A REFERENCE TO ANOTHER MENU */
	       lastmenu = menu.
	       help_exec = execname.
	       menu = execname.
	       menu1[j] = lastmenu.
	       j = j + 1.
	    end.
	 end.
      end.
      j = j - 1.
   end.

   selection = &quot;&quot;.
   menu = &quot;&quot;.
   repeat:
      selection = &quot;N&quot;.
      find msg_mstr where msg_nbr = 36
      and msg_lang = global_user_lang no-lock no-error.
      if not available msg_mstr then leave main-loop.
      {mfmsg01.i 36 1 selection}
      /* &quot;Do you wish to exit from main menu?&quot;*/

      if selection = &quot;Y&quot; then leave main-loop.

      if selection = &quot;P&quot; then do:
	 find first mnd_det where mnd_nbr = &quot;&quot;
	 and mnd_select = 1 no-lock no-error.
	 if not available mnd_det then leave main-loop.
	 if available mnd_det then do:           

	     {mfsec.i &quot;mnd_det&quot;}                            
	     if can_do_menu then leave main-loop.              
	 end.                                               
	 {mfmsg.i 23 3}
	 pause.
      end.

      {mfmsg.i 37 1}
      input clear.
      /* returning to menu */
      menu = &quot;&quot;.
      next main-loop.
   end.
   input clear.
end.
hide all no-pause.

for each qadwkfl where qad_key1 = mfguser:                      
  delete qadwkfl.                                                    
end.                                                                 
</pre>
</body>
</html>
	
	<!-- CoreMail Version 3.1.0 Copyright (c) 2002-2006 www.mailtech.cn -->